package com.ruoyi.business.controller;

import com.ruoyi.business.domain.koc.TbKocTaskType;
import com.ruoyi.business.service.koc.ITbKocTaskTypeService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.util.List;

@Validated
@Api(value = "koc任务类别", tags = {"koc任务类别"})
@RequiredArgsConstructor
@RestController
@RequestMapping("/business/koc/task/type")
public class TbKocTaskTypeController extends BaseController {

    @Resource
    private ITbKocTaskTypeService tbKocTaskTypeService;

    @ApiOperation("查询全部koc任务类型列表")
    @GetMapping("/all")
    public R<List<TbKocTaskType>> queryAll() {
        return R.ok((tbKocTaskTypeService.queryAll()));
    }


    @ApiOperation("获取koc任务类型详情")
    @GetMapping("/{id}")
    public R<TbKocTaskType> getInfo(@ApiParam("主键")
                                    @NotNull(message = "主键不能为空")
                                    @PathVariable("id") Long id) {
        return R.ok(tbKocTaskTypeService.queryById(id));
    }

}
